/*
 * @(#)AjaxUtil.java $version 2012-3-5
 * 
 * Copyright 2011 NADOSTAR Gruop. All rights Reserved.
 * NADOSTAR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nadostar.extensions;

import org.springframework.web.context.request.WebRequest;

/**
 * @author Lixing
 * 
 */
public class AjaxUtil {

	public static boolean isAjaxRequest(WebRequest webRequest) {
		String requestedWith = webRequest.getHeader("X-Requested-With");
		return requestedWith != null ? "XMLHttpRequest".equals(requestedWith) : false;
	}

	public static boolean isAjaxUploadRequest(WebRequest webRequest) {
		return webRequest.getParameter("ajaxUpload") != null;
	}

	private AjaxUtil() {
	}
}
